<?php

class NewsAction extends Action{
    //培训资料
    public function news_list(){
        $tmplParseString = array();
        $tmplParseString['__STATIC__'] = __APP__ . '/static';
        $tmplParseString['__UPLOAD__'] = __APP__ . '/upload';
        $tmplParseString['__SITE_URL__'] = __APP__;
        C('TMPL_PARSE_STRING', $tmplParseString);
        $this->assign('baseurl', getBaseUrl());

        $info = M('news')->where(array('type'=>'0'))->select();
        $this->assign('info',$info);
        $this->display();
    }

    //培训资料详情
    public function news_detail(){
        $tmplParseString = array();
        $tmplParseString['__STATIC__'] = __APP__ . '/static';
        $tmplParseString['__UPLOAD__'] = __APP__ . '/upload';
        $tmplParseString['__SITE_URL__'] = __APP__;
        C('TMPL_PARSE_STRING', $tmplParseString);
        $this->assign('baseurl', getBaseUrl());

        $id = $_GET['id'];
        $info = M('news')->where(array('id'=>$id))->find();
        $this->assign('info',$info);
        $this->display();
    }

    //关于我们
    public function forus_list(){
        $tmplParseString = array();
        $tmplParseString['__STATIC__'] = __APP__ . '/static';
        $tmplParseString['__UPLOAD__'] = __APP__ . '/upload';
        $tmplParseString['__SITE_URL__'] = __APP__;
        C('TMPL_PARSE_STRING', $tmplParseString);
        $this->assign('baseurl', getBaseUrl());

        $info = M('news')->where(array('type'=>1))->select();
        $this->assign('info',$info);
        $this->display();
    }

    //关于我们详情
    public function forus_detail(){
        $tmplParseString = array();
        $tmplParseString['__STATIC__'] = __APP__ . '/static';
        $tmplParseString['__UPLOAD__'] = __APP__ . '/upload';
        $tmplParseString['__SITE_URL__'] = __APP__;
        C('TMPL_PARSE_STRING', $tmplParseString);
        $this->assign('baseurl', getBaseUrl());
        
        //$id = $_GET['id'];
        $info = M('news')->where(array('type'=>'1'))->find();
        $this->assign('info',$info);
        $this->display();
    }
}
